﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SmartProject.Entity;

using FluentNHibernate.Mapping;

namespace SmartProject.Mapping
{
    public class AttachmentMap : ClassMap<Attachment>
    {
        public AttachmentMap()
        {
            Table("SmartProject_Attachment");
            Id(x => x.Id).Column("AttachmentId");
            References<FileType>(x => x.Type)
                .Column("FileTypeId")
                .Not.Nullable();
            References<User>(x => x.Creator)
                .Column("CreatorId")
                .Not.Nullable();
            References<Task>(x => x.Task)
                .Column("TaskId");
            Map(x => x.Filename).Length(300);
            Map(x => x.Content).Length(2147483647);
            Map(x => x.Active).Not.Nullable();
            Map(x => x.Created).Not.Nullable();
        }
    }
}
